package com.sfh.cp.mass.pst.impl;

import com.sfh.cp.mass.pst.IPstMassInfo;
import com.sfh.lib.AppCacheManager;
import com.sfh.lib.mvp.service.AbstractPresenter;

import java.util.Map;

import cn.bmob.v3.BmobQuery;
import cn.bmob.v3.listener.GetListener;
import crm.sfh.server.SMass;

/**
 * 社团详情
 *
 * @date 2018/5/2
 */
public class PstMassInfo extends AbstractPresenter<IPstMassInfo.IVMassInfo> implements IPstMassInfo{

    @Override
    public void getInfo(String id) {
        BmobQuery<SMass> query = new BmobQuery<>();
        query.getObject(AppCacheManager.getApplication(), id, new GetListener<SMass>() {
            @Override
            public void onSuccess(SMass sMass) {
                getView().onSuccessInfo(sMass.getEMass());
            }

            @Override
            public void onFailure(int i, String s) {
                getView().showToast(s);
            }
        });
    }

}
